﻿<UserControl x:Class="ScrumFactory.Projects.CreateProject"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:props="clr-namespace:ScrumFactory.Projects.Properties"        
        
        xmlns:local="clr-namespace:ScrumFactory.Projects"
        xmlns:SF_Validation="clr-namespace:ScrumFactory.Windows.Helpers.ValidationRules;assembly=ScrumFactory.Windows.Helpers"
        
        SnapsToDevicePixels="True"
        
        
        Width="500">    
    
 
    <Grid>
        <!-- BASIC DATA -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>



            <TextBlock                          
            Grid.Column="0" Grid.Row="0"                                    
            Text="{x:Static props:Resources.Project_name}"
            Style="{StaticResource LabelTextBlock}"/>
            <TextBox                          
            Grid.Column="1" Grid.Row="0"  MaxLength="200"
            Text="{Binding ProjectName, UpdateSourceTrigger=PropertyChanged}"            
            HorizontalAlignment="Stretch"/>

            <TextBlock                          
            Grid.Column="0" Grid.Row="1"                                    
            Text="{x:Static props:Resources.Customer}"
            Style="{StaticResource LabelTextBlock}"/>            
            <ComboBox Grid.Column="1" Grid.Row="1"
                      HorizontalAlignment="Stretch"
                      IsEditable="True"
                      Text="{Binding ClientName, UpdateSourceTrigger=PropertyChanged}"
                      ItemsSource="{Binding Clients}"/>

            <TextBlock                          
            Grid.Column="0" Grid.Row="2"           
            Style="{StaticResource LabelTextBlock}"            
            Text="{x:Static props:Resources.Platform}"
            VerticalAlignment="Top"/>
            <ComboBox Grid.Column="1" Grid.Row="2"
                      HorizontalAlignment="Stretch"
                      IsEditable="True"
                      Text="{Binding Platform, UpdateSourceTrigger=PropertyChanged}"
                      ItemsSource="{Binding Platforms}"/>

            <TextBlock                          
            Grid.Column="0" Grid.Row="3"           
            Style="{StaticResource LabelTextBlock}"            
            Text="{x:Static props:Resources.Project_abstract}"
            VerticalAlignment="Top"/>
            <TextBox                          
            Grid.Column="1" Grid.Row="3"                                    
            Height="80" MaxLength="255"
            AcceptsReturn="True" TextWrapping="Wrap"
            Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"
            HorizontalAlignment="Stretch"/>
            
            <CheckBox
                Grid.Column="1" Grid.Row="4"
                IsChecked="{Binding UseLastProjectAsModel}"
                Content="{x:Static props:Resources.use_last_project_as_model}"/>

            <Border Grid.ColumnSpan="2" Grid.Row="5"
                        Background="{StaticResource WindowButtonBar}"                        
                        HorizontalAlignment="Stretch" Margin="0,10,0,0">
                <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
                    <Button
                        Command="{Binding CreateProjectCommand}"
                        HorizontalAlignment="Center"
                        Content="{x:Static props:Resources.Create}"
                        Width="100"
                        Margin="10,5,10,5"/>
                    <Button
                        Command="{Binding CancelCommand}"
                        HorizontalAlignment="Center"
                        Width="100"
                        Content="{x:Static props:Resources.Cancel}"
                        Margin="10,5,10,5"/>

                </StackPanel>


            </Border>



        </Grid>
  
    </Grid>
    
    
</UserControl>
